package com.zretc.activity.controller;


import com.zretc.activity.service.ActivityService;
import com.zretc.api.pojo.activityModule.dtos.ActivityDto;
import com.zretc.common.entity.RespResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/activity")
public class ActivityController {

    @Autowired
    private ActivityService activityService;
    @PostMapping("/submit")
    public RespResult submit(@RequestBody ActivityDto activityDto){
        return activityService.submit(activityDto);
    }
    @GetMapping("/{type}")
    public RespResult getByType(@PathVariable String type){
        return activityService.getByType(type);
    }
    @GetMapping("/getActivityDetails")
    public RespResult getActivityDetails(@RequestBody ActivityDto activityDto){
        return activityService.getActivityDetails(activityDto);
    }
    @DeleteMapping("/delete")
    public RespResult delete(@RequestBody ActivityDto activityDto){
        return activityService.delete(activityDto);
    }
    @PostMapping("/participate")
    public RespResult participate(@RequestBody ActivityDto activityDto){
        return activityService.participate(activityDto);
    }

    @DeleteMapping("/cancel")
    public RespResult cancel(@RequestBody ActivityDto activityDto){
        return activityService.cancel(activityDto);
    }
}
